import { lazy } from 'react'
import Login from '../container/login'
import Home from '../container/home'
import NotFound from '../pages/404'
// const Login = () => import()
// const Home = () => import('../container/home')
// const NotFound = () => import('../pages/404')
const Users = lazy(() => import('../pages/user'))
const Roles = lazy(() => import('../pages/roles'))
const Rights = lazy(() => import('../pages/rights'))
const Goods = lazy(() => import('../pages/goods'))
const Params = lazy(() => import('../pages/params'))
const Categories = lazy(() => import('../pages/categories'))
const Orders = lazy(() => import('../pages/orders'))
const Reports = lazy(() => import('../pages/reports'))
const AddGoods = lazy(() => import('../pages/goods/components/AddGoods'))

// 定义所有路由表单
const routes = [
    { path:'/login', component: Login },
    { path:'/',
      component: Home,
      children: [
      {
        path:'/users',
        component: Users
      },
      {
        path:'/roles',
        component: Roles
      },
      {
        path:'/rights',
        component: Rights
      },
      {
        path:'/goods',
        component: Goods
      },
      {
        path:'/params',
        component: Params
      },
      {
        path:'/categories',
        component: Categories
      },
      {
        path:'/orders',
        component: Orders
      },
      {
        path:'/reports',
        component: Reports
      },
      {
        path:'/goods/add',
        component: AddGoods
      }
    ]
    },
    { path:'/404', component: NotFound }
]

export default routes

